package com.ruoyi.tcsp.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.tcsp.domain.mysql.TcspNewsBase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.tcsp.mapper.TcspNewsBaseMapper;
import com.ruoyi.tcsp.service.ITcspNewsBaseService;

/**
 * 新闻动态Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-26
 */
@Service
public class TcspNewsBaseServiceImpl implements ITcspNewsBaseService 
{
    @Autowired
    private TcspNewsBaseMapper tcspNewsBaseMapper;

    /**
     * 查询新闻动态
     * 
     * @param id 新闻动态主键
     * @return 新闻动态
     */
    @Override
    public TcspNewsBase selectTcspNewsBaseById(Long id)
    {
        return tcspNewsBaseMapper.selectTcspNewsBaseById(id);
    }

    /**
     * 查询新闻动态列表
     * 
     * @param tcspNewsBase 新闻动态
     * @return 新闻动态
     */
    @Override
    public List<TcspNewsBase> selectTcspNewsBaseList(TcspNewsBase tcspNewsBase)
    {
        return tcspNewsBaseMapper.selectTcspNewsBaseList(tcspNewsBase);
    }

    /**
     * 新增新闻动态
     * 
     * @param tcspNewsBase 新闻动态
     * @return 结果
     */
    @Override
    public int insertTcspNewsBase(TcspNewsBase tcspNewsBase)
    {
        tcspNewsBase.setEvalTime(DateUtils.getNowDate());
        return tcspNewsBaseMapper.insertTcspNewsBase(tcspNewsBase);
    }

    /**
     * 修改新闻动态
     * 
     * @param tcspNewsBase 新闻动态
     * @return 结果
     */
    @Override
    public int updateTcspNewsBase(TcspNewsBase tcspNewsBase)
    {
        return tcspNewsBaseMapper.updateTcspNewsBase(tcspNewsBase);
    }

    /**
     * 批量删除新闻动态
     * 
     * @param ids 需要删除的新闻动态主键
     * @return 结果
     */
    @Override
    public int deleteTcspNewsBaseByIds(Long[] ids)
    {
        return tcspNewsBaseMapper.deleteTcspNewsBaseByIds(ids);
    }

    /**
     * 删除新闻动态信息
     * 
     * @param id 新闻动态主键
     * @return 结果
     */
    @Override
    public int deleteTcspNewsBaseById(Long id)
    {
        return tcspNewsBaseMapper.deleteTcspNewsBaseById(id);
    }
}
